package com.gonsin.gnews.annotations.bean;

import com.gonsin.gnews.annotations.model.ConfigValueModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Entity
@Table(name = "gs_news_config", uniqueConstraints = {
        @UniqueConstraint(name = "edifice_key_uni", columnNames = {"edifice_key", "platform"})
})
@ApiModel("消息模板")
@Data
public class ConfigValueBean {

    @ApiModelProperty("主键")
    @Column(name = "config_value_key", columnDefinition = "varchar(64) comment '主键'")
    @Id
    private String configValueKey;

    @ApiModelProperty("所属的会议中心")
    @Column(name = "edifice_key", columnDefinition = "CHAR(32) comment '所属的会议中心'")
    private String edificeKey;

    @ApiModelProperty("平台")
    @Column(name = "platform", columnDefinition = "varchar(32) comment '平台'")
    private String platform;

    @ApiModelProperty("配置内容")
    @Convert(converter = ConfigValueModel.MapMapHandler.class)
    @Column(name = "content", columnDefinition = "TEXT comment '配置内容'")
    private List<ConfigValueModel.ConfigItemPo> content;

}
